You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Includes PayPal (originally #2678)
Include Form Actions refresh (originally #2999)
The PayPal update adds:
New PayPal global payment settings (with buttons to onboard like our Stripe and Square gateways).
New PayPal Commerce payment action.
Payment actions are now split into "Stripe", "Square", and "PayPal" actions. Payment action icons no longer exist unless the Authorize.Net add-on is active, since there is no icon for this gateway (and other possible custom gateways).
Many new payment settings specific to PayPal (Product Name, PayPal Button Settings, Customer syncing behaviour, Shipping address data).
Various UI changes for payment actions (the gateways radio buttons have been replaced by tab buttons and moved to the top of the action, the one time/recurring payment setting has been moved to the top of the action).
The reason will be displayed to describe this comment to others. Learn more.
Variable $action_control might not be defined
A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.
The reason will be displayed to describe this comment to others. Learn more.
Variable $action_controls might not be defined
A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.
The reason will be displayed to describe this comment to others. Learn more.
Variable $allowed might not be defined
A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.
The reason will be displayed to describe this comment to others. Learn more.
Variable $action_controls might not be defined
A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.
The reason will be displayed to describe this comment to others. Learn more.
Variable $action_controls might not be defined
A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.
self::$registered_actions is nullable by type, so iterating self::$registered_actions->actions at Line 139 triggers the current pipeline failure (PossiblyNullIterator).
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@classes/controllers/FrmFormActionsController.php` around lines 139 - 143,
FrmFormActionsController currently iterates self::$registered_actions->actions
while self::$registered_actions is nullable, causing a PossiblyNullIterator
error; guard the loop by ensuring self::$registered_actions is not null and that
the actions collection exists (e.g., check self::$registered_actions !== null
and isset(self::$registered_actions->actions) or use the null-coalescing pattern
to iterate an empty array when actions is absent) before running the foreach
over $action so that $action->action_options['description'] assignment and
checks against $descriptions[$action->id_base] are only executed when a valid
actions iterable is present.
When only PayPal is connected, implode() receives an empty list and Line 4057 produces broken text; the fallback copy on Line 4065 also still excludes PayPal.
Proposed fix
if ( $gateway_connected ) {
$gateway_texts = array();
@@
if ( $square_connected ) {
$gateway_texts['square'] = esc_html__( 'Square', 'formidable' );
}
+ if ( $paypal_connected ) {+ $gateway_texts['paypal'] = esc_html__( 'PayPal', 'formidable' );+ }
$admin_script_strings['pricingFieldsModal']['msg'] = sprintf(
- // translators: %s: Stripe or Square.+ // translators: %s: Connected gateway names.
esc_html__( 'You already have %s connected, so these have already been unlocked.', 'formidable' ),
esc_html( implode( ' ' . esc_html__( 'and', 'formidable' ) . ' ', $gateway_texts ) )
);
@@
- $admin_script_strings['pricingFieldsModal']['msg'] = __( 'We\'ve unlocked Product, Quantity, and Total fields for Lite users! You can now transform your forms into checkout pages. To start collecting revenue, simply connect your preferred payment gateway (Stripe, or Square) in your settings.', 'formidable' );+ $admin_script_strings['pricingFieldsModal']['msg'] = __( 'We\'ve unlocked Product, Quantity, and Total fields for Lite users! You can now transform your forms into checkout pages. To start collecting revenue, simply connect your preferred payment gateway (Stripe, Square, or PayPal) in your settings.', 'formidable' );
}//end if
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@classes/helpers/FrmAppHelper.php` around lines 4047 - 4066, The modal copy
fails to include PayPal and can produce an empty implode result; update the
connected-gateway branch to also check the PayPal flag (e.g. $paypal_connected)
and add $gateway_texts['paypal'] = esc_html__( 'PayPal', 'formidable' ) when
set, and update the fallback message assigned to
$admin_script_strings['pricingFieldsModal']['msg'] to mention PayPal alongside
Stripe and Square; ensure the sprintf that builds
$admin_script_strings['pricingFieldsModal']['msg'] uses the populated
$gateway_texts (e.g. implode( ' ' . esc_html__( 'and', 'formidable' ) . ' ',
$gateway_texts )) so it no longer produces blank output when PayPal is the only
connected gateway.
Guard filtered action map access before reading paypal.
Line 91 still reads $action_classes['paypal'] directly even though frm_registered_form_actions can remove keys, which can emit an undefined index notice.
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@classes/controllers/FrmFormActionsController.php` around lines 91 - 93, The
code reads $action_classes['paypal'] without checking existence which can
trigger an undefined index; update the conditional in FrmFormActionsController
(the block that currently checks 'FrmPayPalLiteAction' ===
$action_classes['paypal'] || ! class_exists('FrmPaymentAction') || !
class_exists('FrmDefPayPalLegacyAction')) to first guard the 'paypal' entry
(e.g., use isset($action_classes['paypal']) or array_key_exists('paypal',
$action_classes)) before comparing to 'FrmPayPalLiteAction', keeping the rest of
the OR conditions and still calling unset($action_classes['paypal-legacy']) when
the combined condition is true.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@classes/views/frm-form-actions/settings.php`:
- Around line 103-127: The loop reuses $single_action_attrs so a previously set
'data-limit' leaks into subsequent actions; inside the iteration that builds
attributes for each action (where $single_action_attrs, $action and
$action_controls are used in classes/views/frm-form-actions/settings.php),
explicitly unset or reset $single_action_attrs['data-limit'] before checking
payment actions, then only set it when the current $action is an uninstalled
payment gateway (paypal, stripe, square); apply the same change to the other
occurrence around the 213-237 block to ensure non-payment actions never inherit
a stale data-limit attribute.
---
Outside diff comments:
In `@classes/controllers/FrmFormActionsController.php`:
- Around line 139-143: FrmFormActionsController currently iterates
self::$registered_actions->actions while self::$registered_actions is nullable,
causing a PossiblyNullIterator error; guard the loop by ensuring
self::$registered_actions is not null and that the actions collection exists
(e.g., check self::$registered_actions !== null and
isset(self::$registered_actions->actions) or use the null-coalescing pattern to
iterate an empty array when actions is absent) before running the foreach over
$action so that $action->action_options['description'] assignment and checks
against $descriptions[$action->id_base] are only executed when a valid actions
iterable is present.
In `@classes/helpers/FrmAppHelper.php`:
- Around line 4047-4066: The modal copy fails to include PayPal and can produce
an empty implode result; update the connected-gateway branch to also check the
PayPal flag (e.g. $paypal_connected) and add $gateway_texts['paypal'] =
esc_html__( 'PayPal', 'formidable' ) when set, and update the fallback message
assigned to $admin_script_strings['pricingFieldsModal']['msg'] to mention PayPal
alongside Stripe and Square; ensure the sprintf that builds
$admin_script_strings['pricingFieldsModal']['msg'] uses the populated
$gateway_texts (e.g. implode( ' ' . esc_html__( 'and', 'formidable' ) . ' ',
$gateway_texts )) so it no longer produces blank output when PayPal is the only
connected gateway.
---
Duplicate comments:
In `@classes/controllers/FrmFormActionsController.php`:
- Around line 91-93: The code reads $action_classes['paypal'] without checking
existence which can trigger an undefined index; update the conditional in
FrmFormActionsController (the block that currently checks 'FrmPayPalLiteAction'
=== $action_classes['paypal'] || ! class_exists('FrmPaymentAction') || !
class_exists('FrmDefPayPalLegacyAction')) to first guard the 'paypal' entry
(e.g., use isset($action_classes['paypal']) or array_key_exists('paypal',
$action_classes)) before comparing to 'FrmPayPalLiteAction', keeping the rest of
the OR conditions and still calling unset($action_classes['paypal-legacy']) when
the combined condition is true.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
Push a commit to this branch (recommended)
Create a new PR with the fixes
ℹ️ Review info⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9828eccf-a0b2-4f93-832a-3c5eb6ceaea8
📥 Commits
Reviewing files that changed from the base of the PR and between ddb15ad and d78f128.
$gateway_connected now treats PayPal as connected, but this branch still builds the connected-gateway list from Stripe/Square only and the fallback CTA still names only Stripe/Square. If PayPal is the only configured gateway, %s renders empty here; if nothing is configured, the copy hides a valid option.
Suggested fix
if ( $gateway_connected ) {
$gateway_texts = array();
if ( $stripe_connected ) {
$gateway_texts['stripe'] = esc_html__( 'Stripe', 'formidable' );
}
if ( $square_connected ) {
$gateway_texts['square'] = esc_html__( 'Square', 'formidable' );
}
++ if ( $paypal_connected ) {+ $gateway_texts['paypal'] = esc_html__( 'PayPal', 'formidable' );+ }
$admin_script_strings['pricingFieldsModal']['msg'] = sprintf(
- // translators: %s: Stripe or Square.+ // translators: %s: Connected payment gateways.
esc_html__( 'You already have %s connected, so these have already been unlocked.', 'formidable' ),
esc_html( implode( ' ' . esc_html__( 'and', 'formidable' ) . ' ', $gateway_texts ) )
);
} else {
@@
- $admin_script_strings['pricingFieldsModal']['msg'] = __( 'We\'ve unlocked Product, Quantity, and Total fields for Lite users! You can now transform your forms into checkout pages. To start collecting revenue, simply connect your preferred payment gateway (Stripe, or Square) in your settings.', 'formidable' );+ $admin_script_strings['pricingFieldsModal']['msg'] = __( 'We\'ve unlocked Product, Quantity, and Total fields for Lite users! You can now transform your forms into checkout pages. To start collecting revenue, simply connect your preferred payment gateway (Stripe, Square, or PayPal) in your settings.', 'formidable' );
}//end if
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@classes/helpers/FrmAppHelper.php` around lines 4044 - 4065, The pricing modal
builds the connected gateway list and fallback CTA text from only
$stripe_connected and $square_connected, causing %s to be empty when PayPal is
the only configured gateway; update the logic in the block that populates
$gateway_texts and the fallback CTA message (references: $gateway_connected,
$stripe_connected, $square_connected, $gateway_texts,
$admin_script_strings['pricingFieldsModal']['msg'] and ['actionText']) to also
check for the PayPal flag (e.g. $paypal_connected or whichever variable tracks
PayPal) and add esc_html__( 'PayPal', 'formidable' ) into $gateway_texts, and
update the fallback CTA copy to mention PayPal alongside Stripe and Square so
the imploded list and messages include PayPal when applicable.
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@paypal/controllers/FrmPayPalLiteActionsController.php` at line 1116, The
return uses number_format($amount, ...) but parent::prepare_amount() returns a
string, causing a type error; cast the value to float before passing to
number_format (e.g., cast the result of parent::prepare_amount() or $amount to
(float)) so number_format receives a float; update the return in
FrmPayPalLiteActionsController (where number_format is called) to use
(float)$amount or cast the call to parent::prepare_amount() to float.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@classes/helpers/FrmAppHelper.php`:
- Around line 4044-4065: The pricing modal builds the connected gateway list and
fallback CTA text from only $stripe_connected and $square_connected, causing %s
to be empty when PayPal is the only configured gateway; update the logic in the
block that populates $gateway_texts and the fallback CTA message (references:
$gateway_connected, $stripe_connected, $square_connected, $gateway_texts,
$admin_script_strings['pricingFieldsModal']['msg'] and ['actionText']) to also
check for the PayPal flag (e.g. $paypal_connected or whichever variable tracks
PayPal) and add esc_html__( 'PayPal', 'formidable' ) into $gateway_texts, and
update the fallback CTA copy to mention PayPal alongside Stripe and Square so
the imploded list and messages include PayPal when applicable.
In `@paypal/controllers/FrmPayPalLiteActionsController.php`:
- Line 1116: The return uses number_format($amount, ...) but
parent::prepare_amount() returns a string, causing a type error; cast the value
to float before passing to number_format (e.g., cast the result of
parent::prepare_amount() or $amount to (float)) so number_format receives a
float; update the return in FrmPayPalLiteActionsController (where number_format
is called) to use (float)$amount or cast the call to parent::prepare_amount() to
float.
ℹ️ Review info⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8ded26e9-b732-477a-ab8b-692bef65419d
📥 Commits
Reviewing files that changed from the base of the PR and between f71ffdc and 088aa7a.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes https://github.com/Strategy11/formidable-pro/issues/6124
Requires https://github.com/Strategy11/formidable-pro/pull/6381/changes to work properly with multi-page forms.
Includes PayPal (originally #2678)
Include Form Actions refresh (originally #2999)
The PayPal update adds:
Summary by CodeRabbit
New Features
Improvements
Chores